/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package test;

import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Properties;

/**
 *
 * @author Administrador
 */
public class LeerArchivoLogin {

    public static void main(String[] args) {
        try {
            final String KEY_FILE = "init.key";
            final String PWD_FILE = "private.properties";
            Properties p2 = new Properties();
            InputStream in = new FileInputStream(PWD_FILE);
            p2.load(in);
            String encryptedPwd = p2.getProperty("pwd");
            String encryptedUsr = p2.getProperty("user");
            System.out.println(encryptedPwd + "\t" + encryptedUsr);
            String user = CryptoUtils.decrypt(encryptedUsr, new File(KEY_FILE));
            String pass = CryptoUtils.decrypt(encryptedPwd, new File(KEY_FILE));
            System.out.println(user + "\t" + pass);
        } catch (Exception e) {
            e.printStackTrace();
        }

    }
}
